import java.awt.BorderLayout;
import javax.swing.JPanel;
import javax.swing.JFrame;
import javax.swing.JButton;
import javax.swing.WindowConstants;

import java.awt.Rectangle;
import javax.swing.ImageIcon;
import javax.swing.JLabel;

public class trade3GUI extends JFrame {

	private static final long serialVersionUID = 1L;
	private JPanel jContentPane = null;
	private JButton jButton = null;
	private JButton jButton1 = null;
	private JButton jButton2 = null;
	private JButton jButton3 = null;
	private JButton jButton4 = null;
	private JButton jButton5 = null;
	private JButton jButton6 = null;
	private JButton jButton7 = null;
	private JButton jButton8 = null;
	private JButton jButton9 = null;
	private JButton jButton10 = null;
	private JLabel jLabel = null;
	private Players[] player;
	private Deeds[] deeds;
	private int playerchosen;
	private int playerturn;
	private JFrame frame;
	private JButton jButton11 = null;
	private PropertyEvent property;
	/**
	 * This is the default constructor
	 */
	public trade3GUI(PropertyEvent property,int chosen, int turn, Players[] players, Deeds[] deeds,JFrame frame) {
		super();
		this.property = property;
		this.playerchosen=chosen;
		this.playerturn=turn;
		this.player=players;
		this.deeds=deeds;
		this.frame=frame;
		initialize();
	}

	/**
	 * This method initializes this
	 * 
	 * @return void
	 */
	private void initialize() {
		this.setSize(855, 600);
		this.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE) ;
		this.setContentPane(getJContentPane());
		this.setTitle("JFrame");
		this.setVisible(true);
	}

	/**
	 * This method initializes jContentPane
	 * 
	 * @return javax.swing.JPanel
	 */
	private JPanel getJContentPane() {
		if (jContentPane == null) {
			jLabel = new JLabel();
			jLabel.setBounds(new Rectangle(429, 523, 16, 22));
			jLabel.setText("2");
			jContentPane = new JPanel();
			jContentPane.setLayout(null);
			jContentPane.add(getJButton(), null);
			jContentPane.add(getJButton1(), null);
			jContentPane.add(getJButton2(), null);
			jContentPane.add(getJButton3(), null);
			jContentPane.add(getJButton4(), null);
			jContentPane.add(getJButton5(), null);
			jContentPane.add(getJButton6(), null);
			jContentPane.add(getJButton7(), null);
			jContentPane.add(getJButton8(), null);
			jContentPane.add(getJButton9(), null);
			jContentPane.add(getJButton10(), null);
			jContentPane.add(jLabel, null);
			jContentPane.add(getJButton11(), null);
		}
		return jContentPane;
	}

	/**
	 * This method initializes jButton	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getJButton() {
		if (jButton == null) {
			jButton = new JButton();
			jButton.setBounds(new Rectangle(0, 0, 847, 10));
		}
		return jButton;
	}

	/**
	 * This method initializes jButton1	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getJButton1() {
		if (jButton1 == null) {
			jButton1 = new JButton();
			if(deeds[8].getOwner()!=player[this.playerturn].getName()){
				jButton1.setEnabled(false);
			}
			jButton1.setBounds(new Rectangle(30, 35, 179, 226));
			jButton1.setIcon(new ImageIcon(getClass().getResource("/Images/StatesAve.jpg")));
			jButton1.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					trade6GUI trade  = new trade6GUI(property,8,playerchosen,playerturn,player,deeds,frame);
					setVisible(false);
				
				}
			});
		}
		return jButton1;
	}

	/**
	 * This method initializes jButton2	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getJButton2() {
		if (jButton2 == null) {
			jButton2 = new JButton();
			if(deeds[9].getOwner()!=player[this.playerturn].getName()){
				jButton2.setEnabled(false);
			}
			jButton2.setBounds(new Rectangle(241, 40, 175, 221));
			jButton2.setIcon(new ImageIcon(getClass().getResource("/Images/Virginia.jpg")));
			jButton2.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					trade6GUI trade  = new trade6GUI(property,9,playerchosen,playerturn,player,deeds,frame);
				}
			});
		}
		return jButton2;
	}

	/**
	 * This method initializes jButton3	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getJButton3() {
		if (jButton3 == null) {
			jButton3 = new JButton();
			if(deeds[10].getOwner()!=player[this.playerturn].getName()){
				jButton3.setEnabled(false);
			}
			jButton3.setBounds(new Rectangle(464, 40, 168, 213));
			jButton3.setIcon(new ImageIcon(getClass().getResource("/Images/PensRR.jpg")));
			jButton3.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					trade6GUI trade  = new trade6GUI(property,10,playerchosen,playerturn,player,deeds,frame);
					setVisible(false);
				}
			});
		}
		return jButton3;
	}

	/**
	 * This method initializes jButton4	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getJButton4() {
		if (jButton4 == null) {
			jButton4 = new JButton();
			if(deeds[11].getOwner()!=player[this.playerturn].getName()){
				jButton4.setEnabled(false);
			}
			jButton4.setBounds(new Rectangle(665, 38, 168, 213));
			jButton4.setIcon(new ImageIcon(getClass().getResource("/Images/James.jpg")));
			jButton4.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					trade6GUI trade  = new trade6GUI(property,11,playerchosen,playerturn,player,deeds,frame);
					setVisible(false);
				}
			});
		}
		return jButton4;
	}

	/**
	 * This method initializes jButton5	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getJButton5() {
		if (jButton5 == null) {
			jButton5 = new JButton();
			if(deeds[12].getOwner()!=player[this.playerturn].getName()){
				jButton5.setEnabled(false);
			}
			jButton5.setBounds(new Rectangle(34, 280, 167, 205));
			jButton5.setIcon(new ImageIcon(getClass().getResource("/Images/Tennesee.jpg")));
			jButton5.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					trade6GUI trade  = new trade6GUI(property,12,playerchosen,playerturn,player,deeds,frame);
					setVisible(false);
				}
			});
		}
		return jButton5;
	}

	/**
	 * This method initializes jButton6	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getJButton6() {
		if (jButton6 == null) {
			jButton6 = new JButton();
			if(deeds[13].getOwner()!=player[this.playerturn].getName()){
				jButton6.setEnabled(false);
			}
			jButton6.setBounds(new Rectangle(253, 279, 171, 208));
			jButton6.setIcon(new ImageIcon(getClass().getResource("/Images/NewYork.jpg")));
			jButton6.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					trade6GUI trade  = new trade6GUI(property,13,playerchosen,playerturn,player,deeds,frame);
					setVisible(false);
				}
			});
		}
		return jButton6;
	}

	/**
	 * This method initializes jButton7	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getJButton7() {
		if (jButton7 == null) {
			jButton7 = new JButton();
			if(deeds[14].getOwner()!=player[this.playerturn].getName()){
				jButton7.setEnabled(false);
			}
			jButton7.setBounds(new Rectangle(469, 280, 171, 212));
			jButton7.setIcon(new ImageIcon(getClass().getResource("/Images/Kentucky.jpg")));
			jButton7.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					trade6GUI trade  = new trade6GUI(property,14,playerchosen,playerturn,player,deeds,frame);
					setVisible(false);
				}
			});
		}
		return jButton7;
	}

	/**
	 * This method initializes jButton8	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getJButton8() {
		if (jButton8 == null) {
			jButton8 = new JButton();
			if(deeds[15].getOwner()!=player[this.playerturn].getName()){
				jButton8.setEnabled(false);
			}
			jButton8.setBounds(new Rectangle(663, 285, 167, 202));
			jButton8.setIcon(new ImageIcon(getClass().getResource("/Images/Indiana.JPG")));
			jButton8.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					trade6GUI trade  = new trade6GUI(property,15,playerchosen,playerturn,player,deeds,frame);
					setVisible(false);
				}
			});
		}
		return jButton8;
	}

	/**
	 * This method initializes jButton9	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getJButton9() {
		if (jButton9 == null) {
			jButton9 = new JButton();
			jButton9.setBounds(new Rectangle(351, 506, 50, 54));
			jButton9.setText("<");
			jButton9.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
				trade2GUI gui = new trade2GUI(property,playerchosen,playerturn,frame,deeds,player);
				setVisible(false);
				}
			});
		}
		return jButton9;
	}

	/**
	 * This method initializes jButton10	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getJButton10() {
		if (jButton10 == null) {
			jButton10 = new JButton();
			jButton10.setBounds(new Rectangle(465, 505, 51, 54));
			jButton10.setText(">");
			jButton10.addActionListener(new java.awt.event.ActionListener() {   
				public void actionPerformed(java.awt.event.ActionEvent e) {    
					trade4GUI gui = new trade4GUI(property,playerchosen,playerturn,player,deeds,frame);
				setVisible(false);
				}
			
			});
		}
		return jButton10;
	}

	/**
	 * This method initializes jButton11	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getJButton11() {
		if (jButton11 == null) {
			jButton11 = new JButton();
			jButton11.setBounds(new Rectangle(576, 505, 106, 55));
			jButton11.setText("cancel trade");
			jButton11.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					frame.setEnabled(true);
					setVisible(false);
					
				}
			});
		}
		return jButton11;
	}

}
